xmalloc_tlsf: Fall back to xmalloc_whole_pages() if xmem_pool_alloc() fails.
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 21 Oct 2009 08:21:01 +0000 (09:21 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 21 Oct 2009 08:21:01 +0000 (09:21 +0100)
commitba0d6cfc6b6cdf9e58ab5c625452ab9c4852764b
tree12876a39452addbf79dd700062a4f4877a459a13
parent2a03afa74dd5960c83fd02fa726cb3b408cfd772
xmalloc_tlsf: Fall back to xmalloc_whole_pages() if xmem_pool_alloc() fails.

This was happening for xmalloc request sizes between 3921 and 3951
bytes. The reason being that xmem_pool_alloc() may add extra padding
to the requested size, making the total block size greater than a
page.

Rather than add yet more smarts about TLSF to _xmalloc(), we just
dumbly attempt any request smaller than a page via xmem_pool_alloc()
first, then fall back on xmalloc_whole_pages() if this fails.

Based on bug diagnosis and initial patch by John Byrne <john.l.byrne@hp.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/xmalloc_tlsf.c